
import {Routes,Route } from 'react-router-dom'
import MyLayout from './MyLayout/MyLayout'
import ActivityManage from './pages/activity/Activitymanage'
import ActivityType from './pages/activity/Activitytype'
import ActivityList from './pages/activity/Activitylists'
import NewsList from './pages/news/Newslists'
import TeacherList from './pages/people/Teacherlist'
import VolunteerList from './pages/people/Volunteerlist'
import ApprovalMenu from './pages/ApprovalMenu'
import Teams from './pages/people/TeamList'

import Homepage from './pages/Homepage'
import { isLogined } from './utils/utils'
import Login from './Login/Login'


function App() {
  return (isLogined()?(<>
    <MyLayout>
      <Routes>
        <Route path='activity/activitylist' element={<ActivityList/>}/>
        <Route path='activity/activitymanage' element={<ActivityManage/>}/>
        <Route path='activity/activitytype' element={<ActivityType/>}/>
        <Route path='news' element={<NewsList/>}/>
        <Route path='people/teacher' element={<TeacherList/>}/>
        <Route path='people/volunteer' element={<VolunteerList/>}/>
        <Route path='people/teams' element={<Teams/>}/>


        <Route path='exa' element={<ApprovalMenu/>}/>
        <Route path='home' element={<Homepage/>}/> 
      </Routes>
    </MyLayout>    
  </>):(<Routes><Route path='/' element={<navigate to='/'/>}/></Routes>))
}

export default App
